package com.laiketui.app.controller.integral;

/**
 * 积分商城
 *
 * @author Trick
 * @date 2021/4/14 9:40
 */
/*@Api(tags = "插件-积分商城")
@RestController
@RequestMapping("/integral")
public class IntegralController {

    @Autowired
    private IntegralService integralService;

    @ApiOperation("我的积分列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "1 获取积分明细 2 使用明细 else 全部明细", dataType = "int", paramType = "form")
    })
    @PostMapping("/getSignInfo")
    @HttpApiMethod(urlMapping = {"app.sign.integral", "app.sign.load_integral"})
    public Result getSignInfo(MainVo vo, Integer type) {
        try {
            return Result.success(integralService.getSignInfo(vo, type));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }

    @ApiOperation("获取我的积分使用说明")
    @PostMapping("/instructions")
    @HttpApiMethod(urlMapping = {"app.sign.Instructions"})
    public Result instructions(MainVo vo) {
        try {
            return Result.success(integralService.instructions(vo));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }

    @ApiOperation("积分商城-积分商品列表")
    @PostMapping("/index")
    @HttpApiMethod(urlMapping = "app.integral.index")
    public Result index(MainVo vo) {
        try {
            return Result.success(integralService.index(vo));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }

    @ApiOperation("获取积分规则")
    @PostMapping("/rule")
    @HttpApiMethod(urlMapping = "app.integral.rule")
    public Result rule(MainVo vo) {
        try {
            return Result.success(integralService.rule(vo));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }


    @ApiOperation("获取商品明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "积分商品id", required = true, dataType = "int", paramType = "form")
    })
    @PostMapping("/goodsdetail")
    @HttpApiMethod(urlMapping = "app.integral.goodsdetail")
    public Result goodsdetail(MainVo vo, int id) {
        try {
            return Result.success(integralService.goodsdetail(vo, id));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }


    @ApiOperation("我的兑换-订单列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderType", value = "订单状态 payment=待支付 send=待发货 receipt=待收货 evaluete=待评价", dataType = "string", paramType = "form")
    })
    @PostMapping("integralOrder")
    @HttpApiMethod(urlMapping = "app.integral.integralOrder")
    public Result integralOrder(MainVo vo, @ParamsMapping("order_type") String orderType) throws LaiKeAPIException {
        try {
            return Result.success(integralService.integralOrder(vo, orderType));
        } catch (LaiKeAPIException e) {
            return Result.error(e.getCode(), e.getMessage());
        }
    }
}*/
